#ifndef CUSTOM_JUMP_FLOOD_INIT_INCLUDED
#define CUSTOM_JUMP_FLOOD_INIT_INCLUDED

#include "GenerateSdfCommon.hlsl"

// Uniform Parameter
uniform int JumpLength;                          // Current Cascade Level n
Texture2D _BlitTexture;
SamplerState sampler_BlitTexture;

float4 JumpFloodInitFragment(Vert2Frag Input) : SV_TARGET {
    float4 RenderResult = _BlitTexture.Load(int3(Input.ScreenUV * _ScreenParams.xy, 0));
    RenderResult.xy = Input.ScreenUV * _ScreenParams.xy;
    if (RenderResult.a < 1e-3) {
        RenderResult.a = MAX_LENGTH;
        RenderResult.xy = float2(-1, -1);
    }
    return RenderResult;
}
#endif